package database

import (
	"gorm.io/gorm"
	"log"
	"server/internal/database/mssql"
	"server/internal/database/mysql"
	"server/internal/database/sqliet"
	"server/pkg/conf"
)

var DB *gorm.DB

func InitDB(config *conf.Config) {
	switch config.Sql.Type {
	case "mysql":
		DB, _ = mysql.InitDB(config)
	case "mssql":
		DB, _ = mssql.InitDB(config)
	case "sqliet":
		DB, _ = sqliet.InitDB(config)
	default:
		log.Panicln(config.Sql.Type, "这个据库类型还没有哪")
	}

}
